package com.sunyard.dal.mapper;

import com.sunyard.dal.bo.log.OperateHistoryBO;
import com.sunyard.dal.bo.warning.NotWorkingTimeBO;
import com.sunyard.dal.bo.warning.NotWorkingTimeInitBo;
import com.sunyard.dal.dto.NotWorkingTimeDTO;
import com.sunyard.dal.dto.OperateHistoryDTO;
import com.sunyard.dal.entity.OperateHistory;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OperateHistoryMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(OperateHistory record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(OperateHistory record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    OperateHistory selectByPrimaryKey(Integer id);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    Integer selectByMacAndOperateTime(OperateHistory record);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(OperateHistory record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(OperateHistory record);

    /**
     * 获取操作日志
     *
     * @return OperateHistoryDTO
     */
    List<OperateHistoryDTO> getHistoryLog(OperateHistoryBO operateHistoryBO);

    //查询未闭锁的数量
    int getNotLocked(@Param("orgIds") List<String> orgIds);

    //未上传日志机构
    int getNotUploadLog(@Param("orgIds") List<String> orgIds);

    //获取非工作时间日志
    List<NotWorkingTimeDTO> getNotWorkingTimeLog(NotWorkingTimeBO notWorkingTimeBO);



    int getNotWorkingTimeLogCountByOrg(NotWorkingTimeInitBo notWorkingTimeInitBo);

    int getLockOperatorCountBySameDay(@Param("orgIds") List<String> orgIds);

    int getLockOperatorCountBySameMonth(@Param("orgIds") List<String> orgIds);

    int getTailBoxOperatorCountBySameDay(@Param("orgIds") List<String> orgIds);

    int getTailBoxOperatorCountBySameMonth(@Param("orgIds") List<String> orgIds);
}